package test;


import org.junit.Test;

import Dao.AdminDao;
import model.Admin;

public class testadmin {
	

//	@Test
	public void testfindByAdminId(){
		int id =1;
		
		Admin admin = new Admin();
		AdminDao adminDao = new AdminDao();
		admin = adminDao.findByAdminId(id);
		
		System.out.println(admin.getAdminPortrait());
	}
	
//	@Test
	public void testaddAdmin() throws Exception{
		
		Admin admin = new Admin();
		admin.setAdminEmail("1234@qq.com");
		admin.setAdminName("jm");
		admin.setAdminPhone(1111111);
		admin.setAdminPortrait("eeeee");
		admin.setAdminPwd("jm");
		admin.setAdminwebadd("sina@sina.cn");
		AdminDao adminDao = new AdminDao();
		int n = adminDao.addAdmin(admin);
		System.out.println(n);
	}
	
	@Test
	public void testReviseAdminByname() throws Exception{
		
		Admin admin = new Admin();
		admin.setAdminEmail("1234@qq.com");
		admin.setAdminName("jm");
		admin.setAdminPhone(1111111);
		admin.setAdminPortrait("eeeee");
		admin.setAdminPwd("jm");
		admin.setAdminwebadd("sina@sina.cn");
		AdminDao adminDao = new AdminDao();
		
		int n = adminDao.ReviseAdminByname(admin);
		System.out.println(n);
		
	}

}
